<include file="Public:header_content" />

    <div class="wrapper wrapper-content animated fadeInRight">
        
        <div class="row">
           
                    <div class="ibox-content">
                        <form id='add-member-form' class="form-horizontal m-t" id="signupForm">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">手机号码：</label>
                                <div class="col-sm-8">
                                    <input id="mobile" name="mobile" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">会员姓名：</label>
                                <div class="col-sm-8">
                                    <input id="username" name="username" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">登录密码：</label>
                                <div class="col-sm-8">
                                    <input id="password" name="password" class="form-control" type="password">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">确认密码：</label>
                                <div class="col-sm-8">
                                    <input id="confirm_password" name="confirm_password" class="form-control" type="password">
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">E-mail：</label>
                                <div class="col-sm-8">
                                    <input id="email" name="email" class="form-control" type="email">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="checkbox" id="agree" name="agree"> 我已经认真阅读并同意《H+使用协议》
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                        <button type="submit" class="btn btn-primary">保存</button>
                                    </div>
                                
                            </div>
                        </form>
           
            </div>
        </div>

    </div>
    
<include file="Public:footer_content" />
<script>
    $.validator.setDefaults({
	highlight:function(e){
		$(e).closest(".form-group").removeClass("has-success").addClass("has-error")},
		success:function(e){
			e.closest(".form-group").removeClass("has-error").addClass("has-success")
		},
		errorElement:"span",
		errorPlacement:function(e,r){
			e.appendTo(r.is(":radio")||r.is(":checkbox")?r.parent().parent().parent():r.parent())
		},
		errorClass:"help-block m-b-none",
		validClass:"help-block m-b-none"
	});
    
    $().ready(function() {
        var e="<i class='fa fa-times-circle'></i> ";
        $("#add-member-form").validate({
			rules:{
				mobile:{
                                    required:!0,
                                    minlength:11,
                                    maxlength:11,
                                    digits:true,
                                    remote: {
                                        url: "<{:U('Public/checkRepeatMobile')}>",     //后台处理程序
                                        type: "post",               //数据发送方式
                                        dataType: "json",           //接受数据格式   
                                        data: {                     //要传递的数据
                                            mobile:function(){
                                                return $('#mobile').val();
                                            }
                                        }
                                    }
                                },
				username:{required:!0,minlength:2},
				password:{required:!0,minlength:5},
				confirm_password:{required:!0,minlength:5,equalTo:"#password"},
				email:{required:!0,email:!0},
				agree:"required"
			},
			messages:{
				mobile:{
                                    required:e+"请输入您的手机号",
                                    minlength:e+"请输入您的手机号有误",
                                    maxlength:e+"请输入您的手机号有误",
                                    digits:e+"请输入手机号码",
                                    remote:e+"该手机号码已被注册"
                                },
				username:{
					required:e+"请输入您的用户名",
					minlength:e+"用户名必须两个字符以上"
				},
				password:{
					required:e+"请输入您的密码",
					minlength:e+"密码必须5个字符以上"
				},
				confirm_password:{
					required:e+"请再次输入密码",
					minlength:e+"密码必须5个字符以上",
					equalTo:e+"两次输入的密码不一致"
				},
				email:e+"请输入您的E-mail",
				agree:{
					required:e+"必须同意协议后才能注册",
					element:"#agree-error"
				}
			}
		});
    });
</script>